﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
namespace _010
{
    internal class Program
    {
        static void Main(string[] args)
        {
            SortedList sl = new SortedList();

            sl.Add("001", "小名");
            sl.Add("002", "小case");
            sl.Add("003", "小强");
            if(sl.ContainsValue("张三"))
            {
                Console.WriteLine("该学生姓名已存在");
            }
            else
            {
                sl.Add("004", "张三");
            }
            //获取键的集合
            ICollection key = sl.Keys;
            foreach(string k in key)
            {
                Console.WriteLine(k + "：" + sl[k]);
            }
            Console.ReadKey();
        }
    }
}
